<template>
  <el-dialog :title="info.title" :visible.sync="visible" append-to-body center width="460px" :before-close="handleCancel">
    <el-form ref="formDate" label-suffix=":" label-width="110px" :rules="rules" :model="form">
      <el-row>
        <el-col :span="24">
          <el-form-item label="账户名称" prop="account_id" style="width: 100%">
            <AccountSelect v-model="form.account_id" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="收款金额" style="width: 100%">
            <el-input v-model="form.xshk_money" size="small" disabled />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="收款日期" prop="collection_date" style="width: 100%">
            <el-date-picker
              v-model="form.collection_date"
              type="date"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
              size="small"
              clearable
              style="width: 100%"
            />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="备注" prop="remark">
            <el-input type="textarea" :rows="4" v-model="form.remark" size="small" clearable />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="fr mt10">
            <el-button size="small" @click="handleCancel()">取 消</el-button>
            <el-button type="primary" size="small" @click="handleEdit()">保 存</el-button>
          </div>
        </el-col>
      </el-row>
    </el-form>
  </el-dialog>
</template>

<script>
import page from '@/utils/page'
import { proXshksCollection } from '@/api/finance/fund'
import AccountSelect from '@/myComponents/AccountSelect'

export default {
  extends: page,
  components: { AccountSelect },
  props: {
    reqUpd: {
      default: proXshksCollection,
      type: Function
    }
  },
  data() {
    return {
      staffs: [],
      rules: {
        account_id: [{ required: true, trigger: 'blur', message: '账户名称不可为空' }],
        collection_date: [{ required: true, trigger: 'blur', message: '收款日期不可为空' }]
      }
    }
  },
  watch: {
    visible(val) {
      if (val) {
        this.form = this.info.edit
      }
    }
  },
  mounted() {
  },
  methods: {
  }
}
</script>

<style>

</style>
